$.get("http://127.0.0.1:8400/getCommdity", {}, function(data) {
    $.each(data, function(index, item) {
        if (index >= 5) {
            $("#div_new").append(`
        <div class="product_column" search_brand_id="24756" search_spu_id="2074616" search_category_id="19" search_product_id="4985438" search_show_id="0" search_hash_id="ht20200506105513p4985438" search_warehouse_id="10994" search_pos="1" price="56">
        <a class="product_img" href="###?$name=${item.name}" target="_blank">
        <img class="product_logo" src=${item.i} onerror="this.style.display='none'">
        <img alt="AHC 玻尿酸B5洗面奶 180ml" src=${item.img}
                class="cloumn_img"></a>
        <a href="www.weibo.com" target="_blank">
            <div class="claoumn_layout">
                <p class="pro_intro">${item.name}</p>
                <div class="price_dis clearfix">
                    <div class="r_pric_box"><em class="big_pic"><span>¥</span>${item.money}</</em><strong><span class="currency_arial">¥</span>${item.strong}</</strong></div>
                    <div class="price_info_text fl"><span><em class="info_num">${item.num}</</em>人已购买</span></div>
                    <div class="numtimer_box">距结束还剩：<span class="dddd" diff="51558"><em>00</em>天<em>13</em>时<em>54</em>分<em>25</em>秒</span></div>
                </div>
            </div>
        </a>
        <a href="www.taobao.com" target="_blank">
        <div class="shopping_car_layout" hid="ht20191106183021p4970446">
            <b class="advance_car_btn" style=" background-image: url(../img/免税店/index_cbtn.png);
            background-repeat: no-repeat;
            display: inline-block;"></b>
      </div>
        </a>
    </div>
    `)
        } else {
            $("#div_new").append(`
    <div class="product_introduce clearfix" id="div_onclick" price="79" search_product_id="4970446" search_brand_id="24134" search_product_type="global_deal" search_hash_id="ht20191106183021p4970446" search_warehouse_id="11000" search_spu_id="2056882" search_category_id="14"
    search_page="1" search_pos="1" search_show_id="0">

    <div class="pro_left">  
        <a href="商品详细.html?name${item.name}" class="pro_a_in"   target="_blank">
            <div class="p_img_lg">
                <img alt="【新版3盒装】蒂佳婷面膜 蓝色补水+绿色舒缓+黑色清洁 药丸面膜" class="img_600" src="${item.img}" style="">
            </div>
        </a>
    </div>
    <div class="pro_right" target="_blank">
        <a href="商品详细.html" target="_blank">
            <div class="flag_box clearfix">
                <div class="flag_box_main fl clearfix">
                    <img src="${item.i}" class="p_img_lg fl" onerror="this.parentNode.style.display='none'">
                    <ul class="flag_text">
                        <li>Korea</li>
                        <li>韩国品牌</li>
                    </ul>
                </div>
                <div class="numtimer_box">
                    <span class="buy_num">距结束还剩</span>
                    <i></i>
                    <span class="dddd" diff="63169"><em>00</em>天<em>17</em>时<em>06</em>分<em>16</em>秒</span>
                </div>
            </div>
            <p class="pro_eng_tit">
                <span class="f15">${item.span} </span>
            </p>
            <p class="pro_des  ">
                <strong>  </strong> ${item.strong} </p>
            <div class="price_dis clearfix">
                <div class="r_pric_box">
                    <em class="big_pic">
                            <span class="currency_arial">¥</span>${item.money}</em>
                    <span class="org_cx">包邮</span>
                </div>
                <div class="advance_head">
                    <span><em>${item.num}</em>人已购买</span>
                </div>
            </div>
        </a>
        <a href="" target="_blank">
            <div class="shopping_car_layout" hid="ht20191106183021p4970446">
                <b class="advance_car_btn" style=" background-image: url(../img/免税店/index_cbtn.png);
                background-repeat: no-repeat;
                display: inline-block;"></b>
            </div>
        </a>
    </div>
</div>`);
        }
    })
}, "JSON");

function goShopping() {
    axios({
        method: "get",
        url: "http://127.0.0.1:8400/goShopping",

    }).then(response => {
        let bool = response.data;
        if (bool != false) {
            alert(bool);
        } else {
            window.location = "../src/登录.html";
        }
    })
}




////////////////分割线
$("#gengduo").mouseover(function() {
    $(".aaaa").css("display", "block");
})
$("#gengduo").mouseout(function() {
    $(".aaaa").css("display", "none");
})

$("#wode").mouseover(function() {
    $(".bbbb").css("display", "block");
})

$("#wode").mouseout(function() {
    $(".bbbb").css("display", "none");
})